export type Rect = {
  width: number;
  height: number;
  left: number;
  right: number;
  top: number;
  bottom: number;
  x: number;
  y: number;
  clientWidth: number;
  clientHeight: number;
  offsetWidth: number;
  offsetHeight: number;
  scrollWidth: number;
  scrollHeight: number;
}

// fillText属性
export type FontCSS = {
  textAlign: "left" | "right" | "center";
  fillStyle: string | CanvasGradient | CanvasPattern;
  fontSize: number;
  fontWeight: number | "bold" | "bolder" | "normal" | "lighter";
  fontFamily: string;
}

// 通用单元格配置
export type CellOption = {
  width: number;
  height: number;
  paddingLeft: number;
  paddingRight: number;
  scrollHorizontalBtnStep: number;
  scrollVerticalBtnStep: number;
} & FontCSS

export type CellInfo = {
  x: number; // 水平索引
  y: number; // 垂直索引
  text: string; // 单元格存储文本
} & CellOption

// 具体某个单元格配置及其信息
export type ConfigCell = {
  text: string;
  x: number;
  y: number;
  // top: number;
  // left: number; // 左对齐使用
  // right: number; // 右对齐使用
  // center: number; // 居中对齐使用
  textAlign: "left" | "right" | "center"; // 单元格内容对齐方式
}

export type ColumnList = {
  left: number; // 字体左
  right: number; // 字体右
  center: number; // 字体中
  width: number; // 列宽
  cellLeft: number; // 列左
  offsetCellLeft: number; // 列左偏移（用于边界内容判断是否绘制过早消失）
  cellRight: number; // 列右
}[]

export type RowList = {
  cellTop: number; // 列上
  offsetCellTop: number;
  cellBottom: number; // 列下
  center: number;
  height: number;
}[]